
function getPackagePathPrefix(){
	return "biz/zheng/";
}

function getContextBase(){//TODO:
	if(typeof(appConfig.getContextPath())!="string"){
		var path = "/";
		var bases = document.getElementsByTagName("base");
	    if (bases && bases.length && bases[0].href) {
	    	path=bases[0].href;
    	}
	    appConfig.setContextPath(path);
	}
    return appConfig.getContextPath();
}

function getScriptBase(){
	return getContextBase()+getPackagePathPrefix();
}

$AppConfig=function(){this.initialize.apply(this, arguments);} 
$AppConfig.prototype={

	initialize : function(name){
		this.name=name?name:"ROOT";
		this.contextPath="/";
		this.locale="zh_cn";
	},
	
	getI18N : function(sKey){/** stub, @see I18N.js */},
	
	getProperty : function(sKey){/** stub, @see Constants.js */
		//return this.constants.get(key);
	},
	
	getConstant : function(sKey){/** stub, @see Constants.js */
		//return this.constants.get(key);
	},
	
	setContextPath : function(newPath){
		if(typeof(newPath)!="string")return;
	  	this.contextPath=this.renderPath(newPath);
	},
	
	getContextPath : function(){
	  	return this.contextPath;
	},
	
	setLocale : function(newLocale){
		if(typeof(newLocale)!="string")return;
		this.locale=newLocale.toLowerCase();
	},
	
	getLocale : function(){
		return this.locale;
	},
	
	renderPath : function(srcPath){
		var path = srcPath;
		var sEnd=path.charAt(path.length-1);
	    if(sEnd!="\\" && sEnd!="/"){
	    	path=path+"/";
	    }
		return path;
	}
} 

appConfig = new $AppConfig("GLOBAL");
if(requestContextPath)appConfig.setContextPath(requestContextPath);
if(requestLocale)appConfig.setLocale(requestLocale);
